package com.sdx.console.rightRole.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.rightRole.dao.RightRoleDao;
import com.sdx.console.rightRole.entity.RightRole;
import com.ibeetl.admin.core.service.BaseService;

/**
 * RightRole Service
 */

@Service
@Transactional
public class RightRoleService extends BaseService<RightRole>{

    @Resource
	private RightRoleDao rightRoleDao;

    public PageQuery<RightRole>queryByCondition(PageQuery query){
        PageQuery ret =  rightRoleDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelRightRole(List<String> ids){
        try {
            rightRoleDao.batchDelRightRoleByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除RightRole失败", e);
        }
    }

	public List<RightRole> all() {
		return rightRoleDao.all();
		}
}